import { Component, OnInit, ViewEncapsulation, ViewChild } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { SkinType, InputType } from 'ngx-weui';
import { DialogModule, DialogService, DialogConfig, DialogComponent } from "ngx-weui/dialog";

@Component({
  selector: 'app-appointrecordinfo',
  templateUrl: './appointrecordinfo.component.html',
  styleUrls: ['./appointrecordinfo.component.css'],
  encapsulation: ViewEncapsulation.None
})
export class AppointrecordinfoComponent implements OnInit {

  @ViewChild('ios') iosAS: DialogComponent;

  private DEFCONFIG: DialogConfig = <DialogConfig>{
    title: '',
    content: '',
    cancel: '',
    confirm: ''
  };
  config: DialogConfig = {};

  constructor(private srv: DialogService) { }

  onShow() {
    this.config = Object.assign({}, this.DEFCONFIG, <DialogConfig>{
      skin: 'ios',
      cancel: '否',
      confirm: '是',
      btns: null,
      title: '取消预约',
      content: '您真的要取消预约吗？取消后不可恢复'
    });
    setTimeout(() => {
      (<DialogComponent>this[`${'ios'}AS`]).show().subscribe((res: any) => {
          console.log('type', res);
      });
    }, 10);
    return false;
  }

  ngOnInit() {
  }

}
